from DBOpr.dbopr import DBOpr_j
import random

dbinfo = {
    "ip": "192.168.2.102",
    "port": 3306,
    "dbName": "sivan",
    "dbtype": "mysql",
    "user": "root",
    "passwd": "Sean..1095"
}
dbo = DBOpr_j(dbinfo)
for i in range(10):
    sqls = []
    for j in range(random.randint(70, 80)):
        sql = f"insert into tb_session (session_key, session_data, session_time) values('{i*j}', '{i*j}_', '2021-05-27')"
        sql2 = f"delete from tb_session where session_key='{i*1-100}'"
        sqls.append(sql)
        sqls.append(sql2)
    dbo.exec(sql)
    data = dbo.execs(sqls)
    print(data)
data = dbo.select("select * from tb_session")
print(len(data))

